|
|
|
|
|
|
|
Figure 14.26
B-spline surfaces of degree two, three, and four. |
|
|
|
|
|
|
|
|
Before learning the definition of the blending functions Ni,k(u), you can explore their behavior. Ni,k(u) is a blending function of degree k. As is the case for two-dimensional B-splines, the degree of the blending functions determines how smoothly the surface fits the control points. If the degree is small, the surface fits the data closely. If the degree is larger, the surface is smoother and does not match the data as closely. |
|
|
|
|
|
|
|
|
Figure 14.26 shows three B-spline surfaces of degree two, three, and four defined by a control grid arranged in a cone shape. The picture on the left fits the data fairly closely. The middle picture is smoother and does not fit the data as well. The picture on the right is very smooth and bears only the slightest resemblance to the original data. |
|
|
|
|
|
|
|
|
To define the blending functions, you need to define a set of knot values that relate the parameters u and v to the control points. Suppose the coordinates of your control points are contained in arrays dimensioned (0 To M, 0 To N). The most commonly used knot values t0 through tM+k for the parameter u are defined for a surface of degree k by the equations: |
|
|
|
 |
|
|
|
|
ti = 0 if i < k
i - k + 1 if k <= i <= M
M - k + 2 if i > M |
|
|
|
|
|
|
|
|
For example, Table 14.1 shows the knot values for a degree three surface where the control points are contained in arrays dimensioned as (0 To 4, 0 To 4). |
|
|
|
|
|
|
|
|
Once you can compute knot values, you can use them to define the blending functions recursively using the following equations: |
|
|
|
 |
|
|
|
|
Ni,1(u) = 0 if ti <= u < ti+1 1 otherwise
Ni,k(u) = (u - ti) * Ni,k-1(u) / (ti+k-1 - ti) +
(ti+k - u) * Ni+1, k-1(u) / (ti+k - ti+1) |
|
|
|
|
| Table 14.1 Knot Values for a Degree Three Surface | | | | | | | | | | | | | | | | | | |
|
|
|